package ru.susu.algebra.partition.filter;

import ru.susu.algebra.partition.Partition;

/**
 * @author akargapolov
 * @since: 09.03.2009
 */
public class AlternatingPartitionsFilter implements IPartitionFilter
{

	@Override
	public boolean checkPartition(Partition partition)
	{
		int sum = 0;
		for (int item : partition.getArrayRepresentation())
			sum += item - 1;
		return sum % 2 == 0;
	}

}
